fix(srv6): Add missing SRv6 SID Structure sub-sub-TLV - #299
Merged
Conversation
The BGP Prefix-SID attribute Galactic advertises for EVPN Type 5 paths carried the destination SID but never described its internal layout. RFC 9252 requires an SRv6 SID Structure Sub-Sub-TLV alongside the SID so receivers know how to interpret it — Galactic's uFMT 48+16 layout (48-bit Block, 16-bit Node-ID, 4-bit Function, 12-bit Argument, no transposition) was never signaled on the wire. prefixSIDAttr now builds that sub-sub-TLV from uformat's existing bit-width constants rather than hardcoding new values, keeping the wire encoding and the eBPF datapath's own bit layout from drifting apart. A new round-trip test serializes the attribute and decodes it back through GoBGP's own DecodeFromBytes to assert on the sub-sub-TLV fields. L2 (uEnd.DT2) and the receive side (nodes still parse SIDs via uformat's fixed offsets, not this TLV) are unaffected — out of scope until L2/EVI support lands. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
ecv
approved these changes
Aug 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The BGP Prefix-SID attribute Galactic advertises for EVPN Type 5 paths carries the destination SID but never described its internal layout. RFC 9252 requires an SRv6 SID Structure Sub-Sub-TLV alongside the SID so receivers know how to interpret it — Galactic's uFMT 48+16 layout (48-bit Block, 16-bit Node-ID, 4-bit Function, 12-bit Argument, no transposition) was never signaled on the wire. Impact was low, since every Galactic node parses SIDs via fixed offsets rather than this TLV, but a spec-compliant third-party EVPN/SRv6 receiver would have been missing the structure description entirely.
prefixSIDAttrnow builds the sub-sub-TLV fromuformat's existing bit-width constants instead of hardcoding new values, so the wire encoding and the eBPF datapath's own bit layout can't silently drift apart.L2 (
uEnd.DT2) and the receive-side path are unaffected — out of scope until L2/EVI support lands.Found via a compliance check against
datum-cloud/enhancements'sarchitecture/design/network/addressing/srv6.md, §"RFC 9252 SRv6 Service Encoding" — there's no tracked issue for this gap.Test plan
task linttask test:unit— covers a new round-trip test that serializes the attribute and decodes it back via GoBGP's ownDecodeFromBytes, asserting on the sub-sub-TLV fieldstask test:e2e— not run; the e2e suite doesn't exercise real BGP path exchange between two GoBGP instances, so it wouldn't observe this attribute on the wire